<?
/* @author Udo Schroeter <udo.schroeter@gmail.com>
 * @license dual license: LGPL / commercial use license
 */ 

  $currentTableId++;
?><table cellspacing="0" cellpadding="3" id="tb_<?= $currentTableId ?>">
  <?
    $inventory = $this->character->getInventory();
    if (sizeof($inventory) == 0)
      print('<b style="font-size: 90%; color: gray">You don\'t own any equipment yet</b>');
      
    foreach ($inventory as $invDS) if ($filterCallback == '' || $filterCallback($invDS))
    {
    $row++;
    $itxt = $this->character->explainItem($invDS);
    if ($itxt != '') $itxt = ToolTip(':'.$itxt);
    $currentRowId++;
    ?><tr id="rw_<?= $currentRowId ?>" <? if ($row % 2 != 0) print('class="tr_odd"'); ?>>
        <td valign="top"><img <?= $itxt ?> width="32" src="img/<?= $invDS['i_icon'] ?>.png"/></td>
        <td valign="top"><div align="right"><?= $invDS['iv_quantity'] ?>x</div></td>
        <td valign="top"><span <?= $itxt ?>><b><?= $invDS['i_name'] ?></b>
          <br/><?= $invDS['i_description'] ?></span>
        </td>
        <td valign="top"><?           
          if ($itxt != '') {
            ?><img src="img/icons/restart.png" <?= $itxt ?>/><?
        } ?></td>
        <td valign="top"><?= $invDS['i_slot'] ?></td>
        <td valign="top" nowrap style="text-align: right;">&nbsp;&nbsp;<?
        if ($invDS['i_type'] == 'wearable')
        {
          if($invDS['iv_on'] == 'N')
            print('<a class="linkbutton" onclick="$(\'#rw_'.$currentRowId.'\').fadeOut(\'slow\'); document.location.replace(\''.actionUrl($_REQUEST['a'], 'character', 'on='.$invDS['i_key']).'\');">put on</a>');
          else
            print('<a class="linkwarnbutton" onclick="$(\'#rw_'.$currentRowId.'\').fadeOut(\'slow\'); document.location.replace(\''.actionUrl($_REQUEST['a'], 'character', 'off='.$invDS['i_key']).'\');">take off</a>'); 
        }
        ?></td>
      </tr><?
    }
  ?>
</table>